<?php

$params = array_merge(
    require(__DIR__ . '/../../common/config/params-dev.php'), require(__DIR__ . '/../../common/config/params-local.php'), require(__DIR__ . '/params.php'), require(__DIR__ . '/params-local.php')
);

return [
    'id' => 'apis',
    'basePath' => dirname(__DIR__),
    'vendorPath' => dirname(dirname(__DIR__)) . '/vendor',
    'bootstrap' => ['log'],
    'components' => [
        'assetManager' => [
            'class' => 'yii\swoole\web\AssetManager',
            'basePath' => '@runtime/assets',
            'baseUrl' => '/runtime/assets'
        ],
        'user' => [
            'identityClass' => \apis\base\models\User::class,
            'enableAutoLogin' => false,
        ],
        'request' => [
            'enableCsrfValidation' => false,
            'parsers' => [
                'application/json' => 'yii\web\JsonParser',
                'text/json' => 'yii\web\JsonParser',
            ],
        ],
        'urlManager' => require(__DIR__ . '/urlManager.php'),
        'log' => [
            'traceLevel' => YII_DEBUG ? 3 : 0,
            'targets' => [
                [
                    'class' => 'yii\log\FileTarget',
                    'levels' => ['error', 'warning'],
                ]
            ],
        ],
        // ...
        'wechat' => [
            'class' => 'apis\wechat\components\Wechat',
        ],
    ],
    'params' => $params,
    'runtimePath' => dirname(__DIR__) . '/web/runtime',
];
